package com.boot;


import java.util.concurrent.CountDownLatch;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

//@SpringBootApplication
@Configuration
@EnableAutoConfiguration
@ComponentScan
public class Application {

	private static final Logger logger = LoggerFactory.getLogger(Application.class);

	@Bean
	public CountDownLatch closeLatch() {
		return new CountDownLatch(1);
	}

	public static void main(String[] args) throws InterruptedException {
		
		SpringApplication.run(Application.class, args);

//		ApplicationContext ctx = new SpringApplicationBuilder().sources(Application.class).web(true).run(args);
//		CountDownLatch closeLatch = ctx.getBean(CountDownLatch.class);

		System.err.println("Seven Startup success");
		logger.info("=======================Seven Startup success!=========================");

//		closeLatch.await();

	}
}
